//
//  AddStudentViewController.m
//  CoachsBook
//
//  Created by MaBookPro on 2022/8/20.
//

#import "AddStudentViewController.h"


#import "ManualAddStudentViewController.h"

@interface AddStudentViewController ()

@end

@implementation AddStudentViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.view.backgroundColor = [UIColor whiteColor];
    //隐藏头部view
    self.navigationController.navigationBar.hidden = YES;
    NavigationHeadView *navgationheadv = [[NavigationHeadView alloc]initWithFrame:CGRectMake(0, 0, APPwidth, SafeAreaTopHight)];
    navgationheadv.titlelabel.text = @"添加学员";
    navgationheadv.titlelabel.textColor = [UIColor blackColor];
    navgationheadv.backbtn.hidden = NO;
    [navgationheadv.backbtn addTarget:self action:@selector(returnback) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:navgationheadv];
    
    NSArray*addstudentImgarr = @[@"phonedaoru",@"shoudongtianjia",@"yaoqingbangding"];
    NSArray *addstudentarr = @[@"手机通讯录导入",@"手动添加学员    ",@"邀请学员并绑定"];

    for (int i = 0; i < addstudentImgarr.count ; i++) {
        
        
        UIButton *addstudentBtn = [[UIButton alloc]initWithFrame:CGRectMake(15, SafeAreaTopHight+i*65+10*i, APPwidth-30, 65)];
        addstudentBtn.titleLabel.textAlignment = 0;
        [addstudentBtn setBackgroundColor:rgba(236, 244, 255, 1)];
        addstudentBtn.titleLabel.font = [UIFont boldSystemFontOfSize:16];
        [addstudentBtn setTitleColor:rgba(51, 51, 51, 1) forState:0];
        addstudentBtn.layer.cornerRadius = 8;
        [addstudentBtn setImage:[UIImage imageNamed:addstudentImgarr[i]] forState:0];
        [addstudentBtn setTitle:addstudentarr[i] forState:0];
        addstudentBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 160);
        [addstudentBtn.imageView setContentMode:UIViewContentModeScaleAspectFit];
        addstudentBtn.titleEdgeInsets = UIEdgeInsetsMake(0, -120, 0, 0);
        [self.view addSubview:addstudentBtn];
        
        if (i == 0 ) {
            [addstudentBtn addTarget:self action:@selector(phoneBtnClick) forControlEvents:UIControlEventTouchUpInside];;
        }else if (i == 1){
            [addstudentBtn addTarget:self action:@selector(handAddBtnClick) forControlEvents:UIControlEventTouchUpInside];;
        }else{
            [addstudentBtn addTarget:self action:@selector(studentBandingBtnClick) forControlEvents:UIControlEventTouchUpInside];;
        }
    }

}
#pragma mark - 手机通讯录导入
-(void)phoneBtnClick{
    
}
#pragma mark - 手动添加学员
-(void)handAddBtnClick{
    ManualAddStudentViewController *vc = [[ ManualAddStudentViewController alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
}
#pragma mark - 邀请学员并绑定
-(void)studentBandingBtnClick{
    
}




-(void)returnback{
    [self.navigationController popViewControllerAnimated:YES];
}
#pragma mark -视图即将出现
-(void)viewWillAppear:(BOOL)animated{
        
    ((TabbarController *)self.tabBarController).tabBarView.hidden = YES;
    
}

@end
